<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    var a = 1, b = 0
    do {
        ++a
        if (a % 3 == 0 && a % 7 == 0) {
            b++
        }
        else {
            b
        }

    } while (b != 35)
    alert(a)
</script>

</html>